{__NOLAYOUT__}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>招聘推荐-{$seo_title}</title>
    <include file="Index:meta" />
</head>

<body>
    <div id="page">
        <!-- Header -->
        <include file="Index:header" />
        <!-- Header End -->

        <div class="banner hide-sm">
            <img src="__PUBLIC__/dist/image/rank_banner.jpg">
        </div>

        <div class="container pt-60 mb-60 recruit">
            <aside class="left">
                <h1 class="mb-40">岗位招聘推荐</h1>
                <div>
                    <a class="active" data-zhuanye="计算机动漫与游戏制作">计算机动漫与游戏制作</a>
                    <a data-zhuanye="服装设计与工艺">服装设计与工艺</a>
                    <a data-zhuanye="计算机平面设计">计算机平面设计</a>
                    <a data-zhuanye="室内设计">室内设计</a>
                    <a data-zhuanye="工艺美术">工艺美术</a>
                    <a data-zhuanye="数字媒体技术应用">数字媒体技术应用</a>
                </div>
            </aside>
            <section class="main">
                <div class="recruit-search">
                    <input type="text" id="gangweiname" placeholder="输入岗位名称、公司名称、工作地点">
                    <button id="searchlist"></button>
                </div>
                <table class="table mb-40">
                    <thead>
                        <tr>
                            <th>岗位名称</th>
                            <th class="hide-sm">公司名称</th>
                            <th>薪资范围</th>
                            <th class="hide-sm">工作地点</th>
                            <th class="hide-sm">来源</th>
                            <th>相关链接</th>
                        </tr>
                    </thead>
                    <tbody id="zhaopinlist">

                    </tbody>
                </table>
                <a class="btn-more center-block" data-p='1'>加载更多</a>
            </section>
        </div>

        <include file="Index:footer" />
    </div>
    <i class="goTop"></i>
    <script>
        $(function () {
             var i = 1;
            // 招聘专业切换
            $(".recruit aside.left").on("click", "a", function () {
                $(".recruit aside.left a").removeClass("active");
                $(this).addClass("active");
                $("#zhaopinlist").html('');
                $(".btn-more").html('加载更多') ;
                i = 1;
                $("#gangweiname").val("");
                var zhuanye = $(this).data('zhuanye');
                refreshlist(zhuanye, '', 1);
            })

            $("#searchlist").on("click", function () {
                i = 1;
                $(".btn-more").html('加载更多') ;
                var leftactive = $('.recruit aside.left a.active').data('zhuanye');
                var title = $("#gangweiname").val();
                $("#zhaopinlist").html('');
                refreshlist(leftactive, title, 1);
            })

            $("#gangweiname").keyup(function(event){
                if(event.keyCode ==13){
                    $("#searchlist").trigger("click");
                }
            });            

            //加载更多
         
            $('.btn-more').on('click', function () {
                i = i + 1;
                var cat = $('.recruit aside.left a.active').data('zhuanye');
                var titledown = $("#gangweiname").val();
                refreshlist(cat, titledown, i);
            })
        })

        function refreshlist(aa, bb, pp) {
            $.ajax({
                type: "POST",
                url: "index.php?g=Home&m=Index&a=getrecruit",
                data: "zhuanye=" + aa + "&title=" + bb + "&page=" + pp,
                dataType: "json",
                success: function (resp) {
                    if (resp != null) {
                        var strHTML = '';
                        $.each(resp, function (k, item) {

                            strHTML += '<tr><td><p class="text-ellipsis">' + item.title + '</p></td>';
                            strHTML += '<td class="hide-sm"><p class="text-ellipsis">' + item.companyname + '</p></td>';
                            strHTML += '<td>' + item.salary + '</td><td class="hide-sm">' + item.workplace + '</td><td class="hide-sm">' + item.comefrom + '</td>';
                            strHTML += ' <td><a target="_blank" href="' + item.url + '">查看</a></td></tr>';

                        });
                        $("#zhaopinlist").append(strHTML);
                    } else {
                        $(".btn-more").html('没有更多');
                    }
                }
            });
        }

        refreshlist('计算机动漫与游戏制作', '', 1);
    </script>
</body>

</html>